package coe.pumbaa

class Post {
    String title
    String description
    String likes = "" //user id who like this post
    Date timestamp
    
    static belongsTo = [category:Category, owner: User]
    static hasMany = [comments:Comment]
    
    static constraints = {
        title(blank:false)
        description(blank:false)
        likes(nullable:true)
    }
    
    static mapping = {
    sort timestamp:"asc"
    }
}
